Return to start page
Other functions available for use are GetFullDamage and GetReducedDamage. GetFullDamage, when passed the actual damage a unit takes (In most cases, GetEventDamage from EVENT_UNIT_DAMAGED event callbacks) and a unit's armor, it will return how much damage was dealt before armor reduction. Similarly, GetReducedDamage, when given the base damage and armor, will return how much damage will be dealt after armor is considered. These functions DO NOT consider armor types in their calculations, so any further reductions or bonuses due to that will need to be considered BEFORE using these functions. I recommend using your damage detection system to modify and build your own armor types anyways. You can use the ObjectMerger call below in order to generate the ability for keeping units with maximum life lower than DAMAGE_TEST from dying when using GetUnitArmor on them. If you do not plan on editing the 'AIlz' ability in your map, you can keep the ObjectMerger call commented out and replace 'lif&' in the configuration constants with 'AIlz'. The 'AIlz' ability adds 50 max life, which is plenty for the script. Function Listing -- function GetUnitArmor takes unit u returns real function GetReducedDamage takes real baseDamage, real armor returns real function GetFullDamage takes real damage, real armor returns real
-
Core/Environment/Library Unit.j
Values that should be changed for your map
-
-
-